/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

/**
 *
 * @author Young Ran
 */
public class NutritionZone {
    private int id;
    private String name;
    private String detail;
    private String type;

    public NutritionZone() {
    }

    public NutritionZone(int id, String name, String detail, String type) {
        this.id = id;
        this.name = name;
        this.detail = detail;
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getDetail() {
        return detail;
    }

    public String getType() {
        return type;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        String des;
        if (detail.length() < 42-name.length()) {
            des = detail;
        } else {
            des = detail.substring(0, 42-name.length()) + "...";
        };
        return "<html><p style='padding:20px;'><font color='white'><b>" + type + " | " + name + "</b> | " + des + "</font></p</html>";
    }
    
}
